PROGRAM = ez
VERSION = 1.0.1

OBJ      =gamehandler.o routemap.o logviewer.o routemapdraw.o main.o route.o routedraw.o teambutton.o 

PKG      = gtkmm-2.4 giomm-2.4 gthread-2.0
CFLAGS	+= $(shell pkg-config --static --cflags $(PKG)) -std=c++11
LDFLAGS	+= -pg
LIBS 	 =  $(shell pkg-config --static  --libs $(PKG))
cc       = gcc
pp       = g++

Debug: all

libs: libez.a libez.so
	

all: ez
	echo cflags $(CFLAGS)
	echo libs $(LIBS)
ez: $(OBJ)
	@echo linking
	$(cc) $(LDFLAGS) $^ -o ez $(LIBS)

libez.a: $(OBJ)
	ar rvs libez.a  $^
	
lib%.so: $(OBJ)
	$(cc) -shared -Wl,-soname,$@.1 -o $@.$(VERSION)  $^
	


%.o: %.c
	@echo
	$(cc) -c $< $(CFLAGS) -o $@
%.o: %.cpp
	@echo making $@
	@echo
	$(pp) --static -c $< $(CFLAGS) -o $@
clean:
	@rm -rf $(PROGRAM) *.o
